import Vue from 'vue';
import VueRouter from 'vue-router';
import App from '../App.vue';

Vue.use(VueRouter);

const lazyLoading = (name) => {
    if (process.env.NODE_ENV === 'development') {
        return () => import(`@/views/${name}.vue`);
    }
    return require(`@/views/${name}.vue`).default;
};

// const DefaultIndex = {
//     render(h) {
//         return h('router-view', {
//             key: this.$route.path,
//         });
//     },
// };

export default new VueRouter({
    base: '/admin/',
    mode: 'history',
    routes: [
        {
            name: 'login',
            path: '/login',
            component: lazyLoading('Login'),
        }, {
            name: 'My.reset',
            path: '/reset-password',
            component: lazyLoading('ResetPassWord'),
        }, {
            path: '/',
            component: require('@/components/layout/Container.vue').default,
            redirect: {
                name: 'Dashboard',
            },
            children: [
                {
                    name: 'Dashboard',
                    path: 'dashboard',
                    meta: {
                        title: '信息面板',
                    },
                    component: lazyLoading('Dashboard'),
                },
                // {
                //     name: 'Dashboard.Course',
                //     path: '/dashboard-course',
                //     meta: {
                //         title: '企业选课',
                //         role: 'company',
                //     },
                //     component: lazyLoading('SelectCourse'),
                // },
                {
                    name: 'Account',
                    path: 'account',
                    meta: {
                        title: '账号权限管理',
                        role: 'admin',
                        permission_id: 1,
                        ico: require('@/assets/images/menu-one.png'),
                    },
                    redirect: {
                        name: 'CompanyManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'CompanyManage',
                            path: 'company',
                            meta: {
                                role: 'admin',
                                title: '企业账号管理',
                            },
                            component: lazyLoading('Company/List'),
                        },
                        {
                            name: 'CompanyManage.Add',
                            path: 'company/form/:id?',
                            component: lazyLoading('Company/Form'),
                        },
                        {
                            name: 'AccountManage',
                            path: 'company/account/:id?',
                            component: lazyLoading('Account/List'),
                        },
                        {
                            name: 'AccountManage.Add',
                            path: 'company/account/form/:id?',
                            component: lazyLoading('Account/Form'),
                        },
                        {
                            name: 'PositionManage',
                            path: 'position',
                            meta: {
                                title: '职位名称设定',
                            },
                            component: lazyLoading('Position/List'),
                        },
                        {
                            name: 'PositionManage.Add',
                            path: 'position/form/:id?',
                            component: lazyLoading('Position/Form'),
                        },
                        {
                            name: 'Company.Log',
                            path: 'company/log/:id?',
                            component: lazyLoading('Company/Log'),
                        },
                    ],
                },
                {
                    name: 'Permission',
                    path: 'permission',
                    meta: {
                        title: '账号权限管理',
                        role: 'company',
                        permission_id: 1,
                        ico: require('@/assets/images/menu-two.png'),
                    },
                    redirect: {
                        name: 'UserManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'UserManage',
                            path: 'user',
                            meta: {
                                role: 'company',
                                title: '配置学员账号',
                            },
                            component: lazyLoading('User/List'),
                        },
                        {
                            name: 'UserManage.Add',
                            path: 'user/form/:id?',
                            component: lazyLoading('User/Form'),
                        },
                        {
                            name: 'UserManage.Account',
                            path: 'user/account/:id?',
                            component: lazyLoading('User/Account'),
                        },
                        // {
                        //     name: 'TeamManage',
                        //     path: 'team',
                        //     meta: {
                        //         role: 'company',
                        //         title: '团队部门设定',
                        //     },
                        //     component: lazyLoading('Team/List'),
                        // },
                        {
                            name: 'TeamManage.Add',
                            path: 'role/form/:id?',
                            component: lazyLoading('Team/Form'),
                        },
                        {
                            name: 'CompanySetManager',
                            path: 'set/manager',
                            meta: {
                                role: 'company',
                                title: '配置管理者账号',
                            },
                            component: lazyLoading('AccountManage/SetManager'),
                        },
                        {
                            name: 'CompanySetManagerDetail',
                            path: 'set/manager/detail/:id?',
                            component: lazyLoading('AccountManage/SetManagerDetail'),
                        },
                        {
                            name: 'CompanyPositionManage',
                            path: 'position',
                            meta: {
                                role: 'company',
                                title: '自定义学员职位名称',
                            },
                            component: lazyLoading('CompanyPosition/List'),
                        },
                        {
                            name: 'CompanyPositionManage.Add',
                            path: 'position/form/:id?',
                            component: lazyLoading('CompanyPosition/Form'),
                        },
                        {
                            name: 'CompanyIdentityName',
                            path: 'identity/name',
                            meta: {
                                role: 'company',
                                title: '自定义管理员身份名称',
                            },
                            component: lazyLoading('AccountManage/IdentityName'),
                        },
                        {
                            name: 'CompanyIdentityNameDetail',
                            path: 'identity/name/detail/:id?',
                            component: lazyLoading('AccountManage/IdentityNameDetail'),
                        },
                        {
                            name: 'CompanyBindAccount',
                            path: 'bind/account',
                            meta: {
                                role: 'company',
                                title: '授权企业微信/钉钉',
                            },
                            component: lazyLoading('AccountManage/Bind'),
                        },
                        {
                            name: 'CompanyStaffApply',
                            path: 'staff/apply',
                            meta: {
                                role: 'company',
                                title: '为员工激活企业微信/钉钉',
                            },
                            component: lazyLoading('AccountManage/Employees'),
                        },
                    ],
                },
                {
                    name: 'Statistics',
                    path: 'statistics',
                    meta: {
                        role: 'admin',
                        title: '报告统计管理',
                        permission_id: 2,
                        ico: require('@/assets/images/menu-two.png'),
                    },
                    redirect: {
                        name: 'CompanyStatisticsManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'CompanyStatisticsManage',
                            path: 'company',
                            meta: {
                                role: 'admin',
                                title: '企业学习统计',
                            },
                            component: lazyLoading('Statistics/Company/List'),
                        },
                        {
                            name: 'CompanyStatisticsManage.Detail',
                            path: 'company/detail/:id?',
                            component: lazyLoading('Statistics/Company/Form'),
                        },
                        {
                            name: 'UserStatisticsManage',
                            path: 'user',
                            meta: {
                                role: 'admin',
                                title: '员工学习统计',
                            },
                            component: lazyLoading('Statistics/User/List'),
                        },
                        {
                            name: 'UserStatisticsManage.Detail',
                            path: 'user/detail/:id?',
                            component: lazyLoading('Statistics/User/Form'),
                        },
                        {
                            name: 'TeamStatisticsManage',
                            path: 'team',
                            meta: {
                                role: 'admin',
                                title: '团队学习统计',
                            },
                            component: lazyLoading('Statistics/Team/List'),
                        },
                        {
                            name: 'TeamStatisticsManage.Detail',
                            path: 'team/detail/:id?',
                            component: lazyLoading('Statistics/Team/Form'),
                        },
                        {
                            name: 'MedalStatisticsManage',
                            path: 'medal',
                            meta: {
                                role: 'admin',
                                title: '勋章课学习统计',
                            },
                            component: lazyLoading('Statistics/Medal/List'),
                        },
                        {
                            name: 'MedalStatisticsManage.Detail',
                            path: 'medal/detail/:id?',
                            component: lazyLoading('Statistics/Medal/Form'),
                        },
                    ],
                },
                {
                    name: 'Statistics.Staff',
                    path: 'statistics',
                    meta: {
                        role: 'all',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Staff.Home',
                            path: 'staff/home/:id?',
                            component: lazyLoading('Statistics/Staff/Home'),
                        },
                        {
                            name: 'Staff.Detail',
                            path: 'staff/detail/:id?',
                            component: lazyLoading('Statistics/Staff/Detail'),
                        },
                        {
                            name: 'Staff.Home.V2',
                            path: 'staff/home/:v/:id?',
                            component: lazyLoading('Statistics/Staff/Home'),
                        },
                        {
                            name: 'Staff.Detail.V2',
                            path: 'staff/detail/:v/:id?',
                            component: lazyLoading('Statistics/Staff/Detail'),
                        },
                    ],
                },
                {
                    name: 'Report',
                    path: 'report',
                    meta: {
                        role: 'company',
                        permission_id: 2,
                        title: '报告统计管理',
                        ico: require('@/assets/images/menu-three.png'),
                    },
                    redirect: {
                        name: 'CompanyStatisticsManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'UserReportManage',
                            path: 'user',
                            meta: {
                                role: 'company',
                                title: '岗位经验栏目学习统计',
                            },
                            component: lazyLoading('Statistics/User/List'),
                        },
                        {
                            name: 'UserReportManage.Detail',
                            path: 'user/detail/:id?',
                            component: lazyLoading('Statistics/User/Form'),
                        },
                        {
                            name: 'MedalStatisticsManage.Company',
                            path: 'medal',
                            meta: {
                                role: 'all',
                                title: '勋章课栏目学习统计',
                            },
                            component: lazyLoading('Statistics/Medal/List'),
                        },
                        // {
                        //     name: 'TeamReportManage',
                        //     path: 'team',
                        //     meta: {
                        //         role: 'company',
                        //         title: '团队学习统计',
                        //     },
                        //     component: lazyLoading('Statistics/Team/List'),
                        // },
                        {
                            name: 'TeamReportManage.Detail',
                            path: 'team/detail/:id?',
                            component: lazyLoading('Statistics/Team/Form'),
                        },
                        {
                            name: 'StatisticsMissionManage',
                            path: 'mission',
                            meta: {
                                role: 'company',
                                title: '学习任务统计&验收',
                            },
                            component: lazyLoading('Statistics/Mission/Home'),
                        },
                        {
                            name: 'StatisticsMissionDetail',
                            path: 'mission/detail/:id?',
                            component: lazyLoading('Statistics/Mission/Detail'),
                        },
                        {
                            name: 'StatisticsMissionSection',
                            path: 'mission/section/:id?',
                            component: lazyLoading('Statistics/Mission/Section'),
                        },
                        {
                            name: 'MedalStatisticsManage.Detail.Company',
                            path: 'medal/detail/:id?',
                            component: lazyLoading('Statistics/Medal/Form'),
                        },
                    ],
                },
                {
                    name: 'Banner',
                    path: 'banner',
                    meta: {
                        role: 'all',
                        permission_id: 4,
                        title: '设置推荐学习内容',
                        ico: require('@/assets/images/menu-four.png'),
                    },
                    redirect: {
                        name: 'BannerManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'BannerManage',
                            path: '',
                            meta: {
                                title: '设置轮播图',
                            },
                            component: lazyLoading('Banner/List'),
                        },
                        {
                            name: 'BannerManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('Banner/Form'),
                        },
                        {
                            name: 'RecommendManage',
                            path: 'recommend',
                            meta: {
                                title: '设置学习推荐',
                            },
                            component: lazyLoading('Recommend/List'),
                        },
                        {
                            name: 'RecommendManage.Add',
                            path: 'recommend/form/:id?',
                            component: lazyLoading('Recommend/Form'),
                        },
                        {
                            name: 'QuotationManage',
                            path: 'quotation',
                            meta: {
                                title: '设置行业洞见',
                            },
                            component: lazyLoading('Quotation/Form'),
                        },
                        {
                            name: 'LabelRecommendManage',
                            path: 'plane',
                            meta: {
                                title: '设置学习计划',
                            },
                            component: lazyLoading('Plane/List'),
                        },
                    ],
                },
                {
                    name: 'Content',
                    path: 'content',
                    meta: {
                        title: '管理学习内容',
                        role: 'all',
                        permission_id: 3,
                        ico: require('@/assets/images/menu-three.png'),
                    },
                    redirect: {
                        name: 'SectionManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'SectionManage',
                            path: '',
                            meta: {
                                title: '发布学习视频或文章',
                            },
                            component: lazyLoading('Section/List'),
                        },
                        {
                            name: 'SectionManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('Section/Form'),
                        },
                        {
                            name: 'LabelRecommendManage.Add',
                            path: 'plane/form/:id?',
                            component: lazyLoading('Plane/Form'),
                        },
                        {
                            name: 'QuestionManage',
                            path: 'question',
                            meta: {
                                title: '发布作业思考题',
                                role: 'admin',
                            },
                            component: lazyLoading('Question/List'),
                        },
                        {
                            name: 'QuestionManage.Add',
                            path: 'question/form/:id?',
                            component: lazyLoading('Question/Form'),
                        },
                        {
                            name: 'MissionManage',
                            path: 'mission',
                            meta: {
                                title: '发布行动清单',
                                role: 'admin',
                            },
                            component: lazyLoading('Mission/List'),
                        },
                        {
                            name: 'MissionManage.Add',
                            path: 'mission/form/:id?',
                            component: lazyLoading('Mission/Form'),
                        },
                        {
                            name: 'CapabilityManage',
                            path: 'capability',
                            meta: {
                                title: '发布胜任力评估题',
                                role: 'admin',
                            },
                            component: lazyLoading('Capability/List'),
                        },
                        {
                            name: 'CapabilityManage.Add',
                            path: 'capability/form/:id?',
                            component: lazyLoading('Capability/Form'),
                        },
                    ],
                },
                {
                    name: 'Label',
                    path: 'label',
                    meta: {
                        role: 'all',
                        permission_id: 5,
                        title: '管理学习体系',
                        ico: require('@/assets/images/menu-five.png'),
                    },
                    redirect: {
                        name: 'LabelManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'CourseManage',
                            path: 'course',
                            meta: {
                                title: '管理学习主题',
                            },
                            component: lazyLoading('Course/List'),
                        },
                        {
                            name: 'LabelManage',
                            path: '',
                            meta: {
                                title: '管理学习路径',
                            },
                            component: lazyLoading('Label/List'),
                        },
                        {
                            name: 'LabelManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('Label/Form'),
                        },
                        // 主题详情页
                        {
                            name: 'LabelManage.Preview',
                            path: 'preview/:id?',
                            component: lazyLoading('Label/Group/Preview'),
                        },
                        // 节点详情页
                        {
                            name: 'LabelManage.Detail',
                            path: 'detail/:id?',
                            component: lazyLoading('Label/Group/Detail'),
                        },
                        {
                            name: 'CategoryManage',
                            path: 'category',
                            meta: {
                                title: '管理学习主题分类名称',
                            },
                            component: lazyLoading('Category/List'),
                        },
                        {
                            name: 'CategoryManage.Add',
                            path: 'category/form/:id?',
                            component: lazyLoading('Category/Form'),
                        },
                        {
                            name: 'CourseManage.Add',
                            path: 'course/form/:id?',
                            component: lazyLoading('Course/Form'),
                        },
                        {
                            name: 'RelevanceStu',
                            path: 'relevance-stu/:type?',
                            component: lazyLoading('LearnSystem/RelevanceStu'),
                        },
                    ],
                },
                {
                    name: 'Template',
                    path: 'template',
                    meta: {
                        role: 'all',
                        permission_id: 10,
                        title: '学习地图模板',
                        ico: require('@/assets/images/menu-three.png'),
                    },
                    redirect: {
                        name: 'Template.Home',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Template.Home',
                            path: 'home',
                            meta: {
                                title: '自定义学习地图',
                            },
                            component: lazyLoading('Template/Home'),
                        },
                        {
                            name: 'Template.Company',
                            path: 'company',
                            meta: {
                                role: 'admin',
                                title: '企业的学习地图模板',
                            },
                            component: lazyLoading('Template/Company'),
                        },
                        {
                            name: 'Template.Detail',
                            path: 'detail',
                            meta: {
                                titles: '学习地图模板详情',
                            },
                            component: lazyLoading('Template/Detail'),
                        },
                        {
                            name: 'Template.Group',
                            path: 'group/:id?',
                            meta: {
                                titles: '组合数据',
                            },
                            component: lazyLoading('Template/Group/GroupTemplate'),
                        },
                    ],
                },
                {
                    name: 'Course.Admin.Selection',
                    path: 'course',
                    meta: {
                        title: '选课管理',
                        ico: require('@/assets/images/menu-three.png'),
                        permission_id: 12,
                        role: 'admin',
                    },
                    component: App,
                    redirect: {
                        name: 'Course.Admin.Home',
                    },
                    children: [
                        {
                            name: 'Course.Admin.Home',
                            path: '',
                            component: lazyLoading('GlobalSetting/Course/Home'),
                            redirect: {
                                name: 'Course.Theme',
                            },
                            meta: {
                                title: '选课管理',
                            },
                            children: [
                                {
                                    name: 'Course.Theme',
                                    path: 'theme',
                                    component: lazyLoading('GlobalSetting/Course/Theme'),
                                },
                                {
                                    name: 'Course.Ability',
                                    path: 'ability',
                                    component: lazyLoading('GlobalSetting/Course/Ability'),
                                },
                                {
                                    name: 'Course.Content',
                                    path: 'content',
                                    component: lazyLoading('GlobalSetting/Course/Content'),
                                },
                                {
                                    name: 'Course.Library',
                                    path: 'library',
                                    component: lazyLoading('GlobalSetting/Course/Library'),
                                },
                            ],
                        },
                        {
                            name: 'Course.Content.Form',
                            path: 'course/content/form/:id?',
                            component: lazyLoading('GlobalSetting/Course/ContentForm'),
                        },
                    ],
                },
                {
                    name: 'Teacher',
                    path: 'teacher',
                    meta: {
                        role: 'all',
                        permission_id: 6,
                        title: '讲师管理',
                        ico: require('@/assets/images/menu-six.png'),
                    },
                    redirect: {
                        name: 'TeacherManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'TeacherManage',
                            path: '',
                            meta: {
                                title: '讲师信息编辑',
                            },
                            component: lazyLoading('Teacher/List'),
                        },
                        {
                            name: 'TeacherManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('Teacher/Form'),
                        },
                    ],
                },
                {
                    name: 'LabelTypeLink',
                    path: 'labeltype',
                    meta: {
                        role: 'admin',
                        title: '岗位角色关联管理',
                        permission_id: 22,
                        icon: 'el-icon-link',
                    },
                    redirect: {
                        name: 'LabelTypeLink.List',
                    },
                    component: App,
                    children: [
                        {
                            name: 'LabelTypeLink.List',
                            path: 'link',
                            meta: {
                                title: '岗位角色关联',
                                role: 'admin',
                            },
                            component: lazyLoading('LabelTypeLink/List'),
                        },
                    ],
                },
                {
                    name: 'Meeting',
                    path: 'meeting',
                    meta: {
                        role: 'admin',
                        permission_id: 19,
                        title: '会议管理',
                        icon: 'el-icon-data-line',
                    },
                    redirect: {
                        name: 'Meeting.Manage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Meeting.Manage',
                            path: '',
                            meta: {
                                title: '会议管理列表',
                            },
                            component: lazyLoading('Meeting/List'),
                        },
                        {
                            name: 'Meeting.Manage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('Meeting/Meeting'),
                        },
                    ],
                },
                {
                    name: 'Work.Advice',
                    path: 'work',
                    meta: {
                        role: 'admin',
                        permission_id: 20,
                        title: '学习主题推荐管理',
                        icon: 'el-icon-monitor',
                    },
                    redirect: {
                        name: 'Work.Advice.List',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Work.Advice.List',
                            path: '/advice',
                            meta: {
                                title: '学习主题管理列表',
                            },
                            component: lazyLoading('WorkAdvice/List'),
                        },
                        {
                            name: 'Work.Advice.Add',
                            path: 'form/:id?',
                            component: lazyLoading('WorkAdvice/Detail'),
                        },
                    ],
                },
                {
                    name: 'OrderManage',
                    path: 'order',
                    meta: {
                        role: 'admin',
                        permission_id: 8,
                        title: '订单管理',
                        icon: 'el-icon-tickets',
                    },
                    redirect: {
                        name: 'Order.List',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Order.List',
                            path: 'list',
                            meta: {
                                title: '订单列表',
                            },
                            component: lazyLoading('Order/List'),
                        },
                    ],
                },
                {
                    name: 'MessageManage',
                    path: 'message',
                    meta: {
                        role: 'admin',
                        title: '消息管理',
                        permission_id: 9,
                        icon: 'el-icon-chat-dot-round',
                    },
                    redirect: {
                        name: 'Message.List',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Message.List',
                            path: 'list',
                            meta: {
                                title: '消息列表',
                            },
                            component: lazyLoading('Message/List'),
                        },
                        {
                            name: 'Message.add',
                            path: 'add',
                            component: lazyLoading('Message/AddMessage'),
                        },
                    ],
                },
                {
                    name: 'Medal',
                    path: 'medal',
                    meta: {
                        role: 'admin',
                        title: '勋章课管理',
                        icon: 'el-icon-notebook-1',
                    },
                    redirect: {
                        name: 'Medal.List',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Medal.List',
                            path: 'list',
                            meta: {
                                title: '勋章课列表',
                            },
                            component: lazyLoading('MedalCourse/List'),
                        },
                        {
                            name: 'Medal.Form',
                            path: 'form/:id?',
                            component: lazyLoading('MedalCourse/Form'),
                        },
                        {
                            name: 'Service.List',
                            path: 'service/list',
                            meta: {
                                title: '额外服务列表',
                            },
                            component: lazyLoading('MedalCourse/Service/List'),
                        },
                        {
                            name: 'Service.Form',
                            path: 'service/form/:id?',
                            component: lazyLoading('MedalCourse/Service/Form'),
                        },
                        {
                            name: 'Chapter.List',
                            path: 'chapter/list',
                            component: lazyLoading('MedalCourse/Chapter/List'),
                        },
                        {
                            name: 'Chapter.Form',
                            path: 'chapter/form/:id?',
                            component: lazyLoading('MedalCourse/Chapter/Form'),
                        },
                        {
                            name: 'Medal.Section.List',
                            path: 'section/list',
                            component: lazyLoading('MedalCourse/Section/List'),
                        },
                        {
                            name: 'Medal.Section.Form',
                            path: 'section/form/:id?',
                            component: lazyLoading('MedalCourse/Section/Form'),
                        },
                    ],
                },
                {
                    name: 'Medal.Cdkey',
                    path: 'medal-cdkey',
                    meta: {
                        role: 'admin',
                        title: '勋章课程兑换码管理',
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'Medal.Cdkey.List',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Medal.Cdkey.List',
                            path: 'list',
                            meta: {
                                title: '勋章课程兑换码列表',
                            },
                            component: lazyLoading('MedalCourseCdkey/List'),
                        },
                        {
                            name: 'Medal.Cdkey.Form',
                            path: 'form/:id?',
                            component: lazyLoading('MedalCourseCdkey/Form'),
                        },
                        {
                            name: 'Medal.Cdkey.Detail',
                            path: 'detail/:id?',
                            component: lazyLoading('MedalCourseCdkey/Detail'),
                        },
                    ],
                },
                {
                    name: 'Teacher.Account',
                    path: 'teacher/account',
                    meta: {
                        role: 'admin',
                        title: '勋章课激活日志',
                        icon: 'el-icon-notebook-2',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Teacher.Account.Home',
                            path: 'list',
                            meta: {
                                title: '讲师账号绑定',
                                role: 'admin',
                            },
                            component: lazyLoading('MedalCourse/Teacher/List'),
                        },
                        {
                            name: 'Teacher.Account.Form',
                            path: 'form/:id?',
                            component: lazyLoading('MedalCourse/Teacher/Form'),
                        },
                        {
                            name: 'Teacher.Account.Log',
                            path: 'log/:id?',
                            component: lazyLoading('MedalCourse/Teacher/Log'),
                        },
                    ],
                },
                {
                    name: 'Teacher.Account.ActiveLog',
                    path: 'teacher/info/log',
                    meta: {
                        role: 'teacher',
                        title: '勋章课激活日志',
                        icon: 'el-icon-notebook-2',
                    },
                    component: lazyLoading('MedalCourse/Teacher/Log'),
                },
                {
                    name: 'Cdkey',
                    path: 'cdkey',
                    meta: {
                        role: 'admin',
                        title: '兑换码管理',
                        permission_id: 13,
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'Cdkey.List',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Cdkey.List',
                            path: 'list',
                            meta: {
                                title: '兑换码列表',
                            },
                            component: lazyLoading('Cdkey/List'),
                        },
                        {
                            name: 'Cdkey.Group',
                            path: 'group/:id?',
                            meta: {
                                titles: '兑换码详情',
                            },
                            component: lazyLoading('Cdkey/Group'),
                        },
                    ],
                },
                {
                    name: 'Harvest',
                    path: 'harvest',
                    meta: {
                        role: 'admin',
                        title: '节点收获表态管理',
                        permission_id: 14,
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'Learn.List',
                    },
                    component: App,
                    children: [
                        {
                            name: 'Learn.List',
                            path: 'learn/list',
                            meta: {
                                title: '学习节点',
                            },
                            component: lazyLoading('Harvest/Learn'),
                        },
                        {
                            name: 'HTeacher.List',
                            path: 'h-teacher/list',
                            meta: {
                                title: '讲师',
                            },
                            component: lazyLoading('Harvest/Teacher'),
                        },
                    ],
                },
                {
                    name: 'Info',
                    path: 'info',
                    meta: {
                        role: 'admin',
                        title: '更多全局设置&信息',
                        permission_id: 7,
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'PositionManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'RoleManage',
                            path: 'role',
                            meta: {
                                title: '企业后台规则管理',
                            },
                            component: lazyLoading('Role/List'),
                        },
                        {
                            name: 'RoleManage.Add',
                            path: 'role/form/:id?',
                            component: lazyLoading('Role/Form'),
                        },
                        {
                            name: 'IndustryManage',
                            path: 'industry',
                            meta: {
                                title: '企业行业管理',
                            },
                            component: lazyLoading('Industry/List'),
                        },
                        {
                            name: 'IndustryManage.Add',
                            path: 'industry/form/:id?',
                            component: lazyLoading('Industry/Form'),
                        },
                        {
                            name: 'CompanyInfoManage',
                            path: 'company',
                            meta: {
                                title: '入住企业信息清单',
                            },
                            component: lazyLoading('Company/InfoList'),
                        },
                        {
                            name: 'CompanyInfoManage.Detail',
                            path: 'company/detail/:id?',
                            component: lazyLoading('Company/InfoDetail'),
                        },
                        {
                            name: 'UserInfoManage',
                            path: 'user',
                            meta: {
                                title: '入住员工信息清单',
                            },
                            component: lazyLoading('User/List'),
                        },
                        {
                            name: 'TeamInfoManage',
                            path: 'team',
                            meta: {
                                title: '企业团队清单',
                            },
                            component: lazyLoading('Team/InfoList'),
                        },
                        {
                            name: 'ServiceAgreementManage',
                            path: 'setting/agreement',
                            meta: {
                                title: '服务协议设置',
                            },
                            component: lazyLoading('Setting/Agreement'),
                        },
                        {
                            name: 'PrivacyManage',
                            path: 'setting/privacy',
                            meta: {
                                title: '隐私协议设置',
                            },
                            component: lazyLoading('Setting/Privacy'),
                        },
                        {
                            name: 'ExpireManage',
                            path: 'expire-manage/list',
                            meta: {
                                title: '用户有效期管理',
                            },
                            component: lazyLoading('GlobalSetting/Expire/List'),
                        },
                        {
                            name: 'ExpireManage.Add',
                            path: 'expire-manage/form/:id?',
                            component: lazyLoading('GlobalSetting/Expire/Form'),
                        },
                        {
                            name: 'ExpireManage.Setting',
                            path: 'expire-manage/setting',
                            meta: {
                                title: '注册免费天数设置',
                            },
                            component: lazyLoading('GlobalSetting/Expire/Setting'),
                        },
                        {
                            name: 'AdminManage',
                            path: 'admin-manage/list',
                            meta: {
                                title: '管理员管理',
                            },
                            component: lazyLoading('GlobalSetting/AdminManage/List'),
                        },
                        {
                            name: 'AdminManage.Add',
                            path: 'admin-manage/form/:id?',
                            component: lazyLoading('GlobalSetting/AdminManage/Form'),
                        },
                        {
                            name: 'UsersManage.List',
                            path: 'users-manage/list',
                            meta: {
                                title: '个人注册用户管理',
                            },
                            component: lazyLoading('User/Manage/List'),
                        },
                        {
                            name: 'Feedback.List',
                            path: 'feedback-manage/list',
                            meta: {
                                title: '反馈管理',
                            },
                            component: lazyLoading('GlobalSetting/Feedback/List'),
                        },
                        {
                            name: 'Invitation.List',
                            path: 'invitation/list',
                            meta: {
                                title: '邀请海报设置',
                            },
                            component: lazyLoading('GlobalSetting/Invitation/List'),
                        },
                        {
                            name: 'Invitation.add',
                            path: 'invitation/add',
                            component: lazyLoading('GlobalSetting/Invitation/AddPosters'),
                        },
                        {
                            name: 'Invitation.setting',
                            path: 'invitation/setting',
                            meta: {
                                title: '邀请奖励设置',
                            },
                            component: lazyLoading('GlobalSetting/Invitation/Setting'),
                        },
                        {
                            name: 'Cdkey.setting',
                            path: 'cdkey/setting',
                            meta: {
                                title: '兑换码开启设置',
                            },
                            component: lazyLoading('GlobalSetting/Cdkey'),
                        },
                        {
                            name: 'Help.Admin.Home',
                            path: 'help/home',
                            meta: {
                                title: '帮助中心发布管理',
                            },
                            component: lazyLoading('GlobalSetting/Help/Home'),
                            redirect: {
                                name: 'Help.Admin.List',
                            },
                            children: [
                                {
                                    name: 'Help.Admin.List',
                                    path: 'list',
                                    component: lazyLoading('GlobalSetting/Help/List'),
                                },
                                {
                                    name: 'Help.Admin.Form',
                                    path: 'form/:id?',
                                    component: lazyLoading('GlobalSetting/Help/Form'),
                                },
                                {
                                    name: 'Help.Admin.Category',
                                    path: 'category',
                                    component: lazyLoading('GlobalSetting/Help/Category'),
                                },
                                {
                                    name: 'Help.Admin.Product',
                                    path: 'product',
                                    component: lazyLoading('GlobalSetting/Help/Product'),
                                },
                            ],
                        },
                        {
                            name: 'Login.Log',
                            path: 'login-log',
                            meta: {
                                title: '管理员账号登录日志',
                            },
                            component: lazyLoading('GlobalSetting/LoginLog'),
                        },
                    ],
                },
                {
                    name: 'CompanyBanner',
                    path: 'company_banner',
                    meta: {
                        role: 'admin',
                        title: '企业自定义栏目维护',
                        permission_id: 15,
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'CompanyBannerManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'CompanyBannerManage',
                            path: '',
                            meta: {
                                title: '企业自定义轮播栏目',
                            },
                            component: lazyLoading('CompanyBanner/List'),
                        },
                        {
                            name: 'CompanyBannerManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('CompanyBanner/Form'),
                        },
                        {
                            name: 'CompanyRecommendManage',
                            path: 'recommend',
                            meta: {
                                role: 'admin',
                                title: '企业自定义学习推荐栏目',
                            },
                            component: lazyLoading('CompanyRecommend/List'),
                        },
                        {
                            name: 'CompanyRecommendManage.Add',
                            path: 'recommend/form/:id?',
                            component: lazyLoading('CompanyRecommend/Form'),
                        },
                        {
                            name: 'CompanyQuotationManage',
                            path: 'quotation',
                            meta: {
                                role: 'admin',
                                title: '企业自定义行业洞见栏目',
                            },
                            component: lazyLoading('CompanyQuotation/List'),
                        },
                        {
                            name: 'CompanyQuotationManage.Add',
                            path: 'quotation/form/:id?',
                            component: lazyLoading('CompanyQuotation/Form'),
                        },
                    ],
                },
                {
                    name: 'CompanyContent',
                    path: 'company_content',
                    meta: {
                        title: '企业自定义学习内容管理',
                        role: 'admin',
                        permission_id: 16,
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'CompanySectionManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'CompanySectionManage',
                            path: '',
                            meta: {
                                title: '企业自定义学习节点',
                            },
                            component: lazyLoading('CompanySection/List'),
                        },
                        {
                            name: 'CompanySectionManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('CompanySection/Form'),
                        },
                        {
                            name: 'CompanyLabelRecommendManage',
                            path: 'plane',
                            meta: {
                                title: '企业自定义学习计划推荐',
                            },
                            component: lazyLoading('CompanyPlane/List'),
                        },
                        {
                            name: 'CompanyLabelRecommendManage.Add',
                            path: 'plane/form/:id?',
                            component: lazyLoading('CompanyPlane/Form'),
                        },
                        {
                            name: 'CompanyQuestionManage',
                            path: 'question',
                            meta: {
                                title: '企业自定义工作场景作业思考题设置',
                            },
                            component: lazyLoading('CompanyQuestion/List'),
                        },
                        {
                            name: 'CompanyQuestionManage.Add',
                            path: 'question/form/:id?',
                            component: lazyLoading('CompanyQuestion/Form'),
                        },
                        {
                            name: 'CompanyMissionManage',
                            path: 'mission',
                            meta: {
                                title: '工作场景行动清单设置',
                            },
                            component: lazyLoading('CompanyMission/List'),
                        },
                        {
                            name: 'CompanyMissionManage.Add',
                            path: 'mission/form/:id?',
                            component: lazyLoading('CompanyMission/Form'),
                        },
                        {
                            name: 'CompanyCapabilityManage',
                            path: 'capability',
                            meta: {
                                title: '工作场景胜任力评估设置',
                            },
                            component: lazyLoading('CompanyCapability/List'),
                        },
                        {
                            name: 'CompanyCapabilityManage.Add',
                            path: 'capability/form/:id?',
                            component: lazyLoading('CompanyCapability/Form'),
                        },
                    ],
                },
                {
                    name: 'CompanyLabel',
                    path: 'company_label',
                    meta: {
                        role: 'admin',
                        title: '企业自定义学习路径管理',
                        permission_id: 17,
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'CompanyLabelManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'CompanyLabelManage',
                            path: '',
                            meta: {
                                title: '企业自定义学习的岗位/专题/计划设定',
                            },
                            component: lazyLoading('CompanyLabel/List'),
                        },
                        {
                            name: 'CompanyLabelManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('CompanyLabel/Form'),
                        },
                        {
                            name: 'CompanyCourseManage',
                            path: 'course',
                            meta: {
                                title: '企业自定义典型工作场景设定',
                            },
                            component: lazyLoading('CompanyCourse/List'),
                        },
                        {
                            name: 'CompanyCourseManage.Add',
                            path: 'course/form/:id?',
                            component: lazyLoading('CompanyCourse/Form'),
                        },
                        {
                            name: 'CompanyCategoryManage',
                            path: 'category',
                            meta: {
                                title: '企业自定义学习难度设定',
                            },
                            component: lazyLoading('CompanyCategory/List'),
                        },
                        {
                            name: 'CompanyCategoryManage.Add',
                            path: 'category/form/:id?',
                            component: lazyLoading('CompanyCategory/Form'),
                        },
                    ],
                },
                {
                    name: 'CompanyTeacher',
                    path: 'company_teacher',
                    meta: {
                        role: 'admin',
                        title: '企业自定义讲师管理',
                        permission_id: 18,
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'CompanyTeacherManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'CompanyTeacherManage',
                            path: '',
                            meta: {
                                title: '企业自定义讲师讲师信息',
                            },
                            component: lazyLoading('CompanyTeacher/List'),
                        },
                        {
                            name: 'CompanyTeacherManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('CompanyTeacher/Form'),
                        },
                    ],
                },
                {
                    name: 'AllPosition',
                    path: 'company_position',
                    meta: {
                        role: 'admin',
                        title: '企业自定义全局设置',
                        permission_id: 21,
                        ico: require('@/assets/images/menu-last.png'),
                    },
                    redirect: {
                        name: 'AllPositionManage',
                    },
                    component: App,
                    children: [
                        {
                            name: 'AllPositionManage',
                            path: '',
                            meta: {
                                title: '企业自定义职位管理',
                            },
                            component: lazyLoading('AllPosition/List'),
                        },
                        {
                            name: 'AllPositionManage.Add',
                            path: 'form/:id?',
                            component: lazyLoading('AllPosition/Form'),
                        },
                    ],
                },
                {
                    name: 'MyProfile',
                    path: 'my-profile',
                    component: lazyLoading('MyProfile'),
                },
            ],
        }, {
            name: 'Help',
            path: '/helps',
            component: lazyLoading('Whelp/Home'),
            meta: {
                title: '帮助中心',
            },
            children: [
                {
                    name: 'Help.Container',
                    path: 'container',
                    component: lazyLoading('Whelp/Container'),
                    children: [
                        {
                            name: 'Help.Question',
                            path: 'question',
                            meta: {
                                title: '问题详情',
                            },
                            component: lazyLoading('Whelp/Question'),
                        },
                        {
                            name: 'Help.Question.List',
                            path: 'question/List',
                            meta: {
                                title: '问题列表',
                            },
                            component: lazyLoading('Whelp/QuestionList'),
                        },
                        {
                            name: 'Help.Log',
                            path: 'log',
                            meta: {
                                title: '日志详情',
                            },
                            component: lazyLoading('Whelp/Log'),
                        },
                        {
                            name: 'Help.Logmore',
                            path: 'log/more',
                            meta: {
                                title: '日志列表',
                            },
                            component: lazyLoading('Whelp/Logmore'),
                        },
                    ],
                },
            ],
        }, {
            name: 'Course.Selection',
            path: '/course-selection',
            meta: {
                title: '企业选课',
            },
            component: lazyLoading('WCourseSelection/Home'),
            children: [
                {
                    name: 'Course.Selection.Container',
                    path: 'container',
                    redirect: {
                        name: 'Course.Selection.Detail',
                    },
                    component: lazyLoading('WCourseSelection/Container'),
                    children: [
                        {
                            name: 'Course.Selection.Detail',
                            path: 'detail',
                            component: lazyLoading('WCourseSelection/Detail'),
                        },
                        {
                            name: 'Course.Selection.Result',
                            path: 'result',
                            component: lazyLoading('WCourseSelection/Result'),
                        },
                    ],
                },
            ],
        }, {
            path: '*',
            redirect: '/',
        },
    ],
});
